package com.weigee.ktv.v.dialog;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;

import com.weigee.ktv.R;
import com.weigee.ktv.v.adapter.rv.CheckRoomNeedAdapter;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by linde on 2017/4/18.
 * <p/>
 * 选择房间大小
 */

public class CheckReserveRoomDialog extends BaseDialog {
    @BindView(R.id.recycler_view)
    RecyclerView mRv;

    @Override
    protected int layout() {
        return R.layout.dialog_check_reserve_room;
    }

    @Override
    protected int minimumWidth(@NonNull DisplayMetrics dm) {
        return dm.widthPixels;
    }

    @Override
    protected int minimumHeight(@NonNull DisplayMetrics dm) {
        return 0;
    }

    @Override
    protected int style() {
        return R.style.WrapDialogStyle_FromBottomToTop;
    }

    @Override
    protected int gravity() {
        return Gravity.BOTTOM;
    }

    @Override
    protected void initView(View view, Bundle savedInstanceState) {
        ButterKnife.bind(this, view);

        final Context context = view.getContext();

        LinearLayoutManager llm = new LinearLayoutManager(context);
        llm.setOrientation(LinearLayoutManager.VERTICAL);
        mRv.setLayoutManager(llm);

        CheckRoomNeedAdapter adapter = new CheckRoomNeedAdapter();
        adapter.add(roomList());
        mRv.setAdapter(adapter);
    }

    private ArrayList<String> roomList() {
        ArrayList<String> list = new ArrayList<>();
        list.add("3～5人小包");
        list.add("6～9人中包");
        list.add("9～12人大包");
        list.add("12～15人豪包");
        list.add("15～60人聚会包");
        return list;
    }
}
